home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
travel_log.gl.p
< prev
next >
Wrap
Text File
|
2003-01-09
|
15KB
|
410 lines
{
Hidden = TRUE;
ChildID = {
GuiAnimation("background") {
AnimationID = "image/travel_log.pcx";
X = 0;
Y = 0;
},
GuiTextInput("screen_name") {
X = 30;
Y = 40;
Width = 70;
Height = 20;
FontID = "font/verdana_9.tf";
InputDisabled = TRUE;
InputText = Mangle(340/*"Travel Log"*/);
},
GuiButton("save_travel_log_button") {
X = 596;
Y = 40;
StyleID = "gui/bs/save_button.gbs";
AutoSize = WIDTH;
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
ResPropSetInt(GuiSiblingByName("save_layer"), "Hidden", FALSE);
ResPropSetInt(GuiSiblingByName("message_layer"), "Hidden", TRUE);
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiLayer("travel_log_layer") {
X = 25;
Y = 60;
ChildID = {
GuiListbox("travel_log") {
X = 0;
Y = 0;
// prevent the listbox from allocating a StrList
// that will never be used by pointing it at one
// of the players travellogs.
StrListID = "Player1TravelLog";
Width = 595;
Height = 400;
FontID = "font/arial_black_14.tf";
ScriptID = Script {
@animate {
resid Player;
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
ResPropSetResID(SELF,"StrListID",ResPropGetResID(Player, "travel_log"));
}
@show {
resid sb_id;
sb_id = GuiChildByName(SELF,"sbV");
ResPropSetInt(sb_id, "Value", ResPropGetInt(sb_id, "MaxValue"));
}
};
ChildID = {
GuiScrollBar ("sbH") {
Kind = HORIZONTAL;
ChildID = {
GuiButton("thumb") {
StyleID = "gui/laptop/scrollbar/sb_thumb.gbs";
},
GuiButton("dec") {
StyleID = "gui/laptop/scrollbar/sb_larrow.gbs";
},
GuiButton("inc") {
StyleID = "gui/laptop/scrollbar/sb_rarrow.gbs";
}
};
},
GuiScrollBar ("sbV") {
Kind = VERTICAL;
ChildID = {
GuiButton("thumb") {
StyleID = "gui/laptop/scrollbar/sb_thumb.gbs";
},
GuiButton("dec") {
StyleID = "gui/laptop/scrollbar/sb_uarrow.gbs";
},
GuiButton("inc") {
StyleID = "gui/laptop/scrollbar/sb_darrow.gbs";
}
};
}
};
}
}; /* END OF TRAVEL_LOG_LAYER CHILDID */
}, /* END OF TRAVEL_LOG */
GuiLayer("save_layer") {
X = 180;
Y = 140;
Hidden = TRUE;
FontID = "font/verdana_black_bold_12.tf";
ChildID = {
GuiAnimation("save_background") {
AnimationID = "gui/laptop/window/laptop_window.pcx";
X = -10;
Y = -20;
Height = 288;
Width = 285;
},
GuiTextInput("instructions_text") {
X = 5;
Y = 0;
Width = 250;
Height = 100;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/verdana_black_bold_12.tf";
InputText = Mangle(341/*"Type a name for your Travel Log and click 'Save'. File names must have less than 27 characters."*/);
},
GuiListbox("save_travel_log_list_box") {
X = 0;
Y = 60;
Height = 120;
Width = 269;
ListHilightedColor = #7FAFFF;
ScriptID = Script {
@show {
GuiListboxClear(SELF);
GuiListboxLoadDirFiltered(SELF, CVarGetStr("SavedTravelLogDir"), "txt");
}
@activate {
str selected_filename;
selected_filename = GuiListboxGetSelected(SELF);
ResPropSetStr(GuiSiblingByName("save_filename_box"),"InputText", selected_filename);
}
};
StrListID = StrList {
Size = 10240;
List = {
""
};
};
ChildID = {
GuiScrollBar ("sb") {
Kind = VERTICAL;
ChildID = {
GuiButton("thumb") {
StyleID = "gui/laptop/scrollbar/sb_thumb.gbs";
},
GuiButton("dec") {
StyleID = "gui/laptop/scrollbar/sb_uarrow.gbs";
},
GuiButton("inc") {
StyleID = "gui/laptop/scrollbar/sb_darrow.gbs";
}
};
}
};
}, /* END OF load_game_list_box */
GuiButton("save_button") {
X = 20;
Y = 220;
TextID = Mangle(250/*"Save"*/);
Width = 100;
AutoSize = HEIGHT;
StyleID = "gui/bs/laptop_button.gbs";
ScriptID = Script {
@update {
str filename;
str filename_ext;
str full_path;
resid Game;
resid Player;
resid message_layer_id;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
message_layer_id = GuiUncleByName("message_layer/message_text");
/* get the filename */
filename = ResPropGetStr(GuiSiblingByName("save_filename_box"),"InputText");
filename_ext = filename;
/* form the full path */
if (StrIn(filename_ext, ".txt")) {
full_path = StrFormatStr("%s%s", CVarGetStr("SavedTravelLogDir"),filename);
} else {
filename_ext = StrFormatStr("%s.txt", filename_ext);
full_path = StrFormatStr("%s%s.txt", CVarGetStr("SavedTravelLogDir"),filename);
}
/* save the game */
StrListToFile(ResPropGetResID(Player, "travel_log"), full_path);
}
@activate {
resid Game;
resid Player;
resid message_layer_id;
str filename;
str filename_ext;
str full_path;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
message_layer_id = GuiUncleByName("message_layer/message_text");
/* get the filename */
filename = ResPropGetStr(GuiSiblingByName("save_filename_box"),"InputText");
/* stop right now if there is nothing */
if (StrExact("",filename)) {
ResPropSetInt(GuiUncleByName("message_layer"), "Hidden", FALSE);
ResPropSetStr(message_layer_id,"InputText",MangleSIDToStr(251/*"You must type a file name."*/));
stop;
}
/* check that the length of the filename is not too long */
if (StrLen(filename) >= 27) {
ResPropSetInt(GuiUncleByName("message_layer"), "Hidden", FALSE);
ResPropSetStr(message_layer_id,"InputText",MangleSIDToStr(252/*"The file name you have chosen is too long."*/));
stop;
}
/* check if the filename is empty */
if (StrExact("",filename)) {
ResPropSetInt(GuiUncleByName("message_layer"), "Hidden", FALSE);
ResPropSetStr(message_layer_id,"InputText",MangleSIDToStr(253/*"You must type a file name."*/));
} else {
ResPropSetStr(Game,"game_save_log_name", filename);
}
filename_ext = filename;
/* form the full path */
if (StrIn(filename_ext, ".txt")) {
full_path = StrFormatStr("%s%s", CVarGetStr("SavedTravelLogDir"),filename);
} else {
filename_ext = StrFormatStr("%s.txt", filename_ext);
full_path = StrFormatStr("%s%s.txt", CVarGetStr("SavedTravelLogDir"),filename);
}
/* check if the filename exist */
if (FileExist(full_path)) {
ResPropSetInt(GuiUncleByName("file_check_layer"), "Hidden", FALSE);
ResPropSetStr(GuiUncleByName("file_check_layer/message_text"), "InputText", StrFormatStr(MangleSIDToStr(254/*"This folder already contains a file named '%s'. Would you like to replace the existing file?"*/), filename_ext));
stop;
} else {
ResPropSetInt(GuiUncleByName("file_check_layer"), "Hidden", TRUE);
}
/* save the game */
if (StrListToFile(ResPropGetResID(Player, "travel_log"), full_path) ) {
ResPropSetInt(GuiUncleByName("message_layer"), "Hidden", FALSE);
ResPropSetStr(message_layer_id,"InputText",StrFormatStr(MangleSIDToStr(255/*"Your travel log has been saved to '%s'."*/), filename_ext));
ResPropSetInt(GuiUncleByName("message_layer/ok_save_button"),"Hidden", FALSE);
} else {
ResPropSetInt(GuiUncleByName("message_layer"), "Hidden", FALSE);
ResPropSetStr(message_layer_id,"InputText",MangleSIDToStr(256/*"Could not save travel log. Check save travel log path in options menu."*/));
}
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiButton("cancel_button") {
X = 153;
Y = 220;
TextID = Mangle(257/*"Cancel"*/);
StyleID = "gui/bs/laptop_button.gbs";
Width = 100;
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
ResPropSetInt(ResByName("travel_log.gl/save_layer"),"Hidden", TRUE);
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiTextInput("save_filename_box") {
AnimationID = "gui/square/window/window_text_entry.pcx";
X = 5;
Y = 190;
Width = 250;
Height = 22;
FontID = "font/verdana_9_black.tf";
InsertCursorID = "gui/dash/tab/insert_cursor.pcx";
OverwriteCursorID = "gui/dash/tab/overwrite_cursor.pcx";
InputText = "";
} /* END OF save_filename */
}; /* END OF SAVE LAYER CHILDID */
},
GuiLayer("file_check_layer") {
X = 160;
Y = 180;
Hidden = TRUE;
FontID = "font/verdana_black_bold_12.tf";
ChildID = {
GuiAnimation("save_background") {
AnimationID = "gui/laptop/window/laptop_window.pcx";
X = 0;
Y = 0;
Height = 120;
Width = 350;
},
GuiButton("yes_button") {
X = 55;
Y = 88;
TextID = Mangle(258/*"YES"*/);
Width = 100;
StyleID = "gui/bs/laptop_button.gbs";
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
ResPropSetInt(ResByName("travel_log.gl/file_check_layer"),"Hidden", TRUE);
ResParseEvent(ResByName("travel_log.gl/save_layer/save_button"), "@update");
ResPropSetInt(ResByName("travel_log.gl/save_layer"),"Hidden", TRUE);
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiButton("no_button") {
X = 190;
Y = 88;
TextID = Mangle(259/*"NO"*/);
Width = 100;
StyleID = "gui/bs/laptop_button.gbs";
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
ResPropSetInt(ResByName("travel_log.gl/file_check_layer"),"Hidden", TRUE);
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiTextInput("message_text") {
X = 10;
Y = 17;
Width = 300;
Height = 70;
WordWrap = TRUE;
InputDisabled = TRUE;
}
}; /* END OF message_layer CHILDID */
},
GuiLayer("message_layer") {
X = 160;
Y = 180;
Hidden = TRUE;
FontID = "font/verdana_black_bold_12.tf";
ScriptID = Script {
@show {
ResPropSetInt(ResByName("travel_log.gl/save_layer"),"Hidden", TRUE);
ResPropSetInt(SELF,"Hidden", FALSE);
}
};
ChildID = {
GuiAnimation("save_background") {
AnimationID = "gui/laptop/window/laptop_window.pcx";
X = 0;
Y = 0;
Height = 120;
Width = 350;
},
GuiButton("ok_error_button") {
X = 120;
Y = 82;
TextID = Mangle(260/*"OK"*/);
Width = 100;
StyleID = "gui/bs/laptop_button.gbs";
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
ResPropSetInt(ResByName("travel_log.gl/message_layer"),"Hidden", TRUE);
ResPropSetInt(ResByName("travel_log.gl/save_layer"),"Hidden", FALSE);
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiButton("ok_save_button") {
X = 120;
Y = 82;
TextID = Mangle(261/*"OK"*/);
Width = 100;
Hidden = TRUE;
StyleID = "gui/bs/laptop_button.gbs";
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
ResPropSetInt(GuiSiblingByName("ok_error_button"),"Hidden",FALSE);
ResPropSetInt(ResByName("travel_log.gl/message_layer"),"Hidden", TRUE);
ResPropSetInt(ResByName("travel_log.gl/save_layer"),"Hidden", TRUE);
ResPropSetInt(SELF,"Hidden", TRUE);
}
}; /* END OF SAVE BUTTON SCRIPT */
},
GuiTextInput("message_text") {
X = 10;
Y = 17;
Width = 300;
Height = 50;
WordWrap = TRUE;
InputDisabled = TRUE;
}
}; /* END OF message_layer CHILDID */
}
}; /* END OF MAIN CHILID */
}